<?php

/*
Name: test-cases.php
Author: Justin Williamson [epicoxymoron@gmail.com]
Description: Test Cases Page
Last Modified: 10/20/2008
*/

require_once "includes/config.php";
require_once INCLUDE_DIR."/header.inc.php";
require_once INCLUDE_DIR."/footer.inc.php";
require_once INCLUDE_DIR."/db.inc.php";
require_once INCLUDE_DIR."/status.inc.php";

$req = new HTML_Template_IT( TEMPLATE_DIR );
$req->loadTemplatefile( "test_cases.tpl.html", true, true );

$query = "SELECT `id`, `short` FROM `test_case` WHERE 1";

$query .= " ORDER BY id ASC";
$query = mysql_query( $query );

if( mysql_num_rows( $query ) == 0 ) {
	$req->setVariable( "NONE_MESSAGE", "No Data Found! Use the Add button to add a new Test Case!" );
	$req->parse( "none" );
}
else {
	while( $result = mysql_fetch_object( $query ) ) {
		$req->setVariable( "TEST_CASE_ID", $result->id );
		$req->setVariable( "TEST_CASE_SHORT_DESCRIPTION", $result->short );
		$req->parse( "row" );
	}
}

$req->touchBlock( '__global__' );

$header->show();
$req->show();
$footer->show();

?>